<?php
namespace app\index\controller;
/**
 * Created by Submint Text.
 * User: hetaoren<452649510@qq.com>
 * Date: 2017/03/10
 * Explain: 库存日志控制器
 */
class Stocklog extends Base{
   /**
	* 查看库存列表
	*/
	public function index(){
        $shopId = input('shopId/d',0);
        $goodsId = input('goodsId/d',0);
        if($shopId){
            session('shopId', $shopId);
        }else{
            session('shopId', null);
        }
        if($goodsId){
            session('goodsId', $goodsId);
        }else{
            session('goodsId', null);
        }
        $time1 = strtotime('2017-10'); 
        $monarr = []; 
        while(($time1 = strtotime('+1 month', $time1)) <= time()){  
              $monarr[] = date('Y-m',$time1); // 取得递增月;   
        }    
        $this->assign("monarr",$monarr);
        $shopList = model('shops')->where(['dataFlag'=>1])->column('shopId,shopName');
        $this->assign("shopList",$shopList);
		return $this->fetch();
	}
    /**
     * 获取分页
     */
    public function pageQuery(){
        return model('StockLog')->pageQuery();
    }
}
